
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module LogFile</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>LogFile</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/media/disk-1/data/zdstack/trunk/ZDStack/LogFile.py">/media/disk-1/data/zdstack/trunk/ZDStack/LogFile.py</a></font></td></tr></table>
    <p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="logging.html">logging</a><br>
<a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="select.html">select</a><br>
<a href="time.html">time</a><br>
</td><td width="25%" valign=top><a href="traceback.html">traceback</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="LogFile.html#LogFile">LogFile</a>
</font></dt></dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="LogFile">class <strong>LogFile</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt><a href="#LogFile">LogFile</a>&nbsp;represents&nbsp;a&nbsp;zserv&nbsp;log&nbsp;file.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="LogFile-__init__"><strong>__init__</strong></a>(self, log_type, parser, zserv, listeners<font color="#909090">=[]</font>)</dt><dd><tt>Initializes&nbsp;a&nbsp;<a href="#LogFile">LogFile</a>&nbsp;instance.<br>
&nbsp;<br>
log_type:&nbsp;&nbsp;a&nbsp;string&nbsp;representing&nbsp;the&nbsp;kind&nbsp;of&nbsp;<a href="#LogFile">LogFile</a>&nbsp;this&nbsp;is,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;valid&nbsp;options&nbsp;are&nbsp;"client"&nbsp;and&nbsp;"server"<br>
parser:&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;LogParser&nbsp;instance<br>
zserv:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;ZServ&nbsp;instance<br>
listeners:&nbsp;a&nbsp;list&nbsp;of&nbsp;LogListener&nbsp;instances&nbsp;to&nbsp;send&nbsp;events&nbsp;to</tt></dd></dl>

<dl><dt><a name="LogFile-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>

<dl><dt><a name="LogFile-__str__"><strong>__str__</strong></a>(self)</dt></dl>

<dl><dt><a name="LogFile-get_response"><strong>get_response</strong></a>(self)</dt><dd><tt>Returns&nbsp;the&nbsp;list&nbsp;of&nbsp;saved&nbsp;response&nbsp;events.</tt></dd></dl>

<dl><dt><a name="LogFile-log"><strong>log</strong></a>(self)</dt><dd><tt>Watches&nbsp;a&nbsp;file&nbsp;for&nbsp;log&nbsp;events.<br>
&nbsp;<br>
When&nbsp;events&nbsp;are&nbsp;found&nbsp;they&nbsp;are&nbsp;placed&nbsp;in&nbsp;the&nbsp;event&nbsp;queue&nbsp;of<br>
every&nbsp;listener&nbsp;in&nbsp;self.<strong>listeners</strong>.</tt></dd></dl>

<dl><dt><a name="LogFile-set_filepath"><strong>set_filepath</strong></a>(self, filepath, seek_to_end<font color="#909090">=False</font>)</dt><dd><tt>Sets&nbsp;the&nbsp;filepath&nbsp;of&nbsp;the&nbsp;logfile&nbsp;to&nbsp;watch.<br>
&nbsp;<br>
filepath:&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;string&nbsp;representing&nbsp;the&nbsp;full&nbsp;path&nbsp;to&nbsp;the&nbsp;new<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;logfile<br>
seek_to_end:&nbsp;a&nbsp;boolean&nbsp;whether&nbsp;or&nbsp;not&nbsp;to&nbsp;seek&nbsp;to&nbsp;the&nbsp;end&nbsp;of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;new&nbsp;logfile</tt></dd></dl>

<dl><dt><a name="LogFile-start"><strong>start</strong></a>(self)</dt><dd><tt>Starts&nbsp;logging&nbsp;events.</tt></dd></dl>

<dl><dt><a name="LogFile-stop"><strong>stop</strong></a>(self)</dt><dd><tt>Stops&nbsp;logging&nbsp;events.</tt></dd></dl>

<dl><dt><a name="LogFile-watch_for_response"><strong>watch_for_response</strong></a>(self, response_event_type)</dt><dd><tt>Starts&nbsp;watching&nbsp;for&nbsp;a&nbsp;certain&nbsp;event&nbsp;type.<br>
&nbsp;<br>
response_event_type:&nbsp;a&nbsp;string&nbsp;representing&nbsp;the&nbsp;type&nbsp;of&nbsp;event<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;watch&nbsp;for.<br>
&nbsp;<br>
This&nbsp;method&nbsp;starts&nbsp;watching&nbsp;for&nbsp;a&nbsp;certain&nbsp;event&nbsp;type,&nbsp;and<br>
stores&nbsp;matching&nbsp;events&nbsp;in&nbsp;self.<strong>response_events</strong>.&nbsp;&nbsp;A&nbsp;Logfile<br>
stops&nbsp;watching&nbsp;for&nbsp;response&nbsp;events&nbsp;only&nbsp;when&nbsp;it&nbsp;finds&nbsp;a<br>
matching&nbsp;event&nbsp;(or&nbsp;events)&nbsp;and&nbsp;then&nbsp;finds&nbsp;one&nbsp;that&nbsp;doesn't.<br>
&nbsp;<br>
There&nbsp;is&nbsp;also&nbsp;a&nbsp;time&nbsp;out&nbsp;of&nbsp;1/20&nbsp;of&nbsp;a&nbsp;second,&nbsp;so&nbsp;this&nbsp;doesn't<br>
lockup&nbsp;the&nbsp;response&nbsp;mechanism.</tt></dd></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-Lock"><strong>Lock</strong></a> = allocate_lock(...)</dt><dd><tt>allocate_lock()&nbsp;-&gt;&nbsp;lock&nbsp;object<br>
(allocate()&nbsp;is&nbsp;an&nbsp;obsolete&nbsp;synonym)<br>
&nbsp;<br>
Create&nbsp;a&nbsp;new&nbsp;lock&nbsp;object.&nbsp;&nbsp;See&nbsp;LockType.__doc__&nbsp;for&nbsp;information&nbsp;about&nbsp;locks.</tt></dd></dl>
</td></tr></table>
</body></html>